home *** CD-ROM | disk | FTP | other *** search
- function CSBrowserSwitch(action) {
- var bAgent = window.navigator.userAgent;
- var bAppName = window.navigator.appName;
-
- var isNS = (bAppName.indexOf("Netscape") >= 0);
- var isIE = (bAppName.indexOf("Explorer") >= 0);
- var isWin = (bAgent.indexOf("Win") >= 0);
- var isMac = (bAgent.indexOf("Mac") >= 0);
-
- var vers = 0;
- var versIdx = (bAgent.indexOf("Mozilla/"));
-
- if(versIdx >= 0)
- {
- var sstr = bAgent.substring(versIdx + 8, versIdx + 9);
- vers = parseInt(sstr) - 2;
- }
-
- var url = action[1];
- var platform = action[2];
-
- var versVec;
- if(platform)
- {
- if(isNS && isMac) versVec = action[3];
- if(isIE && isMac) versVec = action[4];
- if(isNS && isWin) versVec = action[5];
- if(isIE && isWin) versVec = action[6];
- }
- else
- {
- if(isNS) versVec = action[3];
- if(isIE) versVec = action[4];
- }
-
- if(vers > (versVec.length-1))
- vers = versVec.length-1;
- if(versVec[vers] == 0)
- {
- location = url;
- CSStopExecution = true;
- }
- }
-
-